package com.zysf.library_boot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 借阅记录（谁在何时借走了什么书，并且有没有归还，归还时间多少）
 * @TableName lend_list
 */
@AllArgsConstructor
@NoArgsConstructor
@TableName(value ="lend_list")
@Data
public class LendList implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 图书id
     */
    private Integer bookid;

    /**
     * 读者id
     */
    private Integer readerid;

    /**
     * 借书时间
     */
    private Date lenddate;

    /**
     * 还书时间
     */
    private Date backdate;

    /**
     * 
     */
    private Integer backtype;

    /**
     * 备注信息
     */
    private String exceptremarks;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        LendList other = (LendList) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getBookid() == null ? other.getBookid() == null : this.getBookid().equals(other.getBookid()))
            && (this.getReaderid() == null ? other.getReaderid() == null : this.getReaderid().equals(other.getReaderid()))
            && (this.getLenddate() == null ? other.getLenddate() == null : this.getLenddate().equals(other.getLenddate()))
            && (this.getBackdate() == null ? other.getBackdate() == null : this.getBackdate().equals(other.getBackdate()))
            && (this.getBacktype() == null ? other.getBacktype() == null : this.getBacktype().equals(other.getBacktype()))
            && (this.getExceptremarks() == null ? other.getExceptremarks() == null : this.getExceptremarks().equals(other.getExceptremarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getBookid() == null) ? 0 : getBookid().hashCode());
        result = prime * result + ((getReaderid() == null) ? 0 : getReaderid().hashCode());
        result = prime * result + ((getLenddate() == null) ? 0 : getLenddate().hashCode());
        result = prime * result + ((getBackdate() == null) ? 0 : getBackdate().hashCode());
        result = prime * result + ((getBacktype() == null) ? 0 : getBacktype().hashCode());
        result = prime * result + ((getExceptremarks() == null) ? 0 : getExceptremarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", bookid=").append(bookid);
        sb.append(", readerid=").append(readerid);
        sb.append(", lenddate=").append(lenddate);
        sb.append(", backdate=").append(backdate);
        sb.append(", backtype=").append(backtype);
        sb.append(", exceptremarks=").append(exceptremarks);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}